package demo.rabbitmq;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class MqController {

    @Resource
    MessageProvider messageProvider;

    @GetMapping("/send")
    public String sendMessages(String param) {
        try {
            messageProvider.send(param);
            return "发送成功";
        } catch (Exception e) {
            e.printStackTrace();
            return "发送失败";
        }
    }
}
